import request from '@/utils/request'

// 获取组织列表
export function getDepartmentListAPi() {
  return request({
    url: '/company/department',
    method: 'get',
  })
}
//获取部门负责人的数据
export function getManagerListAPi() {
  return request({
    url: '/sys/user/simple'
  })
}
//新增部门
export function addDepartmentAPi(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
//删除部门
export function delDepartmentAPi(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
//获取部门详情
export function getDepartmentDetailAPi(id) {
  return request({
    url: `/company/department/${id}`
  })
}
//修改部门
export function updateDepartmentAPi(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}